<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <link th:href="@{/css/Semantic-UI-CSS-master/semantic.css}" href="../static/css/Semantic-UI-CSS-master/semantic.css" rel="stylesheet" type="text/css">
    <link th:href="@{/css/main.css}" href="../static/css/main.css" rel="stylesheet" type="text/css">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>Title</title>
    <script th:src="@{/js/jquery-3.4.0.js}" src="../static/js/jquery-3.4.0.js" type="text/javascript"></script>
    <script th:src="@{/css/Semantic-UI-CSS-master/semantic.js}" src="../static/css/Semantic-UI-CSS-master/semantic.js" type="text/javascript"></script>
</head>
<body>
<!--顶部导航-->
<nav class="ui inverted attached segment" id="nav">
    <div class="ui container">
        <div class="ui inverted secondary menu">
            <h2 class="ui teal header item">Blog</h2>
            <a href="/index" class="item active"><i class="home icon"></i> 首页</a>
            <a href="/type" class="item"><i class="idea icon"></i> 分类</a>
            <a href="/tag" class="item"><i class="tags icon"></i> 标签</a>
            <div class="center item" style="margin-left: 100px">
                <form class="ui input inverted icon transparent" action="/search" id="search">
                    <input type="text" name="keyword" placeholder="Search">
                    <i class="search link icon" onclick="f()"></i>
                </form>
            </div>
        </div>
    </div>
</nav>
<!--中间内容-->
<div class="m-container m-padded-large">
    <div class="ui container">
        <div class="ui grid">
            <!--文章列表-->
            <div class="eleven wide column">
                <!--文章标头-->
                <div class="ui segment top attached">
                    <div class="ui two column grid middle aligned">
                        <div class="column">
                            <h3 class="ui teal header">博客</h3>
                        </div>
                        <div class="column right aligned">
                            共 <h2 class="ui orange header m-inline-block" th:text="${blogPageInfo.total}">14</h2> 篇
                        </div>
                    </div>
                </div>
                <!--文章-->
                <div class="ui segment attached">
                    <div class="ui segment vertical m-padded-large" th:each="blog:${blogPageInfo.getList()}">
                            <div class="ui grid">
                                <div class="eleven wide column">
                                    <a th:href="|/blog?blogId=${blog.id}|" target="_blank">
                                        <h3 class="ui header m-padded-mini" style="margin-left: 7px" th:text="${blog.title}">Bootstrap 教程</h3>
                                    </a>
                                    <a th:href="|/blog?blogId=${blog.id}|" style="color: black" target="_blank">
                                        <p class="m-text-spaced m-padded-middle" th:text="${blog.content}">
                                            Bootstrap，来自 Twitter，是目前最受欢迎的前端框架。Bootstrap 是基于 HTML、CSS、JAVASCRIPT 的...
                                        </p>
                                    </a>
                                    <div class="ui grid">
                                        <div class="eleven wide column">
                                            <div class="ui horizontal link list">
                                                <div class="item">
                                                    <img th:src="${blog.user.img}" src="img/brain.jpg" class="ui avatar image">
                                                    <div class="content"><a href="#" class="header" th:text="${blog.user.name}">梅迪乌斯</a></div>
                                                </div>
                                                <div class="item">
                                                    <i class="calendar icon"></i><span th:text="${blog.updateTime}">2021-01-01</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="right aligned five wide column">
                                            <a th:href="|/type?typeId=${blog.type.id}|" class="ui teal basic label m-padded-mini" target="_blank" th:text="${blog.type.name}">认知升级</a>
                                        </div>
                                    </div>
                                </div>
                                <div class="five wide column">
                                    <a th:href="|/blog?blogId=${blog.id}|" target="_blank">
                                        <img th:src="${blog.picture}" src="../static/img/background.jpg" class="ui rounded image">
                                    </a>
                                </div>
                            </div>
                        </div>
                </div>
                <!--翻页-->
                <div class="ui bottom attached segment">
                    <div class="ui grid middle aligned">
                        <div class=" three wide column">
                            <form action="/index" method="get" th:if="${blogPageInfo.prePage>0}">
                                <input type="hidden" name="pageNum" value="1">
                                <button class="ui button mini teal basic item">
                                    首页
                                </button>
                            </form>
                        </div>
                        <div class=" three wide column">
                            <form action="/index" method="get" th:if="${blogPageInfo.prePage>0}">
                                <input type="hidden" name="pageNum" th:value="${blogPageInfo.prePage}">
                                <button class="ui button mini teal basic item">
                                    上一页
                                </button>
                            </form>
                        </div>
                        <div class=" four wide column" th:text="|第${blogPageInfo.pageNum}页/共${blogPageInfo.pages}页|">
                            当前页/总页数
                        </div>
                        <div class=" three wide column">
                            <form action="/index" method="get" th:if="${blogPageInfo.nextPage}>1">
                                <input type="hidden" name="pageNum" th:value="${blogPageInfo.nextPage}">
                                <button class="ui button mini teal basic item">
                                    下一页
                                </button>
                            </form>
                        </div>
                        <div class=" three wide column">
                            <form action="/index" method="get" th:if="${blogPageInfo.pageNum}<${blogPageInfo.pages}">
                                <input type="hidden" name="pageNum" th:value="${blogPageInfo.pages}">
                                <button class="ui button mini teal basic item">
                                    尾页
                                </button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <!--分类列表-->
            <div class="five wide column">
                <div class="ui segments">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column"><i class="idea icon"></i> 分类</div>
                            <div class="right aligned column"><a href="/type" target="_blank">more<i class="angle double right icon"></i> </a> </div>
                        </div>
                    </div>
                    <div class="ui segment teal">
                        <a th:href="|/type?typeId=${type.id}|" class="ui labeled button m-margin-small" tabindex="0" th:each="type:${typeList}">
                            <div class="ui teal basic button" th:text="${type.name}">
                                学习日志
                            </div>
                            <div class="ui red basic left pointing label" th:text="${type.getBlogs().size()}">
                                13
                            </div>
                        </a>
                    </div>
                </div>
                <!--标签列表-->
                <div class="ui segments">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column"><i class="tag icon"></i> 标签</div>
                            <div class="right aligned column"><a href="/tag">more<i class="angle double right icon"></i> </a> </div>
                        </div>
                    </div>
                    <div class="ui teal segment">
                        <a th:each="tag:${tagList}" th:href="|/tag?tagId=${tag.id}|" class="ui teal basic left pointing label m-margin-small">
                            <span th:text="${tag.name}">方法论</span>
                        </a>
                    </div>
                </div>
                <!--最新推荐-->
                <div class="ui segments">
                    <div class="ui secondary segment">
                        <div class="column"><i class="bookmark icon"></i> 最新推荐</div>
                    </div>
                    <div class="ui segment" th:each="blog:${recommendBlog}">
                        <a th:href="|/blog?blogId=${blog.id}|" target="_blank" th:text="${blog.title}">用户故事</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--底部导航-->
<footer class="ui segment vertical">
    <div class="ui center aligned container">
        <div class="ui section divider"></div>
        Copyright ©2019-2023 SimpleBook Designed by Harlaus
        <br>
        备案号：津ICP备20005778号-1公安备案号津公网安备 12011602000448 号
        </p>
    </div>
</footer>
<script>
    $('.ui.dropdown').dropdown({
        on : 'hover'
    });
    function f() {
        $("#search").submit();
    }
</script>
</body>
</html>